*==================================================================================* * Programmer: James Nguyen, US EPA * * * * Project: Power and effect size inflation in epi. studies * * * * Purpose: * * - applicable to studies where ORs are estimated * * * * - estimate the power of the study design by the proportion of: * * + OR > 1 and p-value <= alpha, given true OR > 1 * * + OR < 1 and p-value <= alpha, given true OR < 1 * * * * - characterizes the distribution of observed significant ORs * * * * Notes: * * * * - Updates of current SAS version "ESM proportion 2.sas" vs. previous SAS * * version "ESM proportion.sas": * * * * + current version uses a more efficient data structure for each * * simulated binomial dataset. This change substantially reduces the * * running time and is much faster compared to the previous version. * * * * + current version uses p-value <= alpha vs. previous version which * * used a lower bound of (100*(1-alpha) CI) > 1 to calculate power. * * * * + current version uses CHI-SQUARE/EXACT test in PROC FREQ vs. * * previous version which used WALD/EXACT test in PROC LOGISTIC. * * * * + current version uses same test (either CHI_SQUARE test or EXACT * * test) for all datasets vs. previous version which used * * the WALD test for the datasets for which the models converged and * * EXACT test for the datasets for which the model did not converge. * * * * - All datasets for which both groups have 0 values for all subjects are * * now not included in the data analysis. * * * * - Regardless of 1-sided test or 2-sided test, the power only counts the * * significant ORs > 1 if true OR > 1 or significant ORs < 1 if true OR < 1 * * * * - This Macro is the revision of the code version revised in 10/2019 * * * * Date: 10/2021 * *================================================================================= *; option nodate nonumber formDlim="=" ls=95 ps=100 ; %Macro ESM_proportion(P0=, /* proportion of disease/exposed in reference group */ OR=, /* true odds ratios */ N0=, /* sample size of reference group */ N1=, /* sample size of comparison group */ Test=, /* EXACT or CHISQ */ alpha=, /* level of significance */ nsided=, /* 1 or 2 for 1-sided test or 2-sided test */ pctiles=, /* percentiles of significant ORs: 2.5, 5, 10, 25, 50, 75, 90, 95, 97.5 */ ipctiles=, /* percentiles that need to calculate inflation factors */ NSim=, /* number of iterations, i.e. datasets */ seed=, /* seed number to reproduce random numbers */ outfile=); DM "log; clear"; Proc datasets nolist; save sasmacr; run;quit; *===> count number of control rates; %let P0N=1; %let P0&P0N = %nrbquote(%scan(&P0,&P0N, %str( ))); %do %while (&&P0&P0N ^=); %let P0N=%eval(&P0N+1); %let P0&P0N = %nrbquote(%scan(&P0,&P0N, %str( ))); %end; %let P0N=%eval(&P0N-1); *===> count number of ORs; %let ORN=1; %let OR&ORN = %nrbquote(%scan(&OR,&ORN, %str( ))); %do %while (&&OR&ORN ^=); %let ORN=%eval(&ORN+1); %let OR&ORN = %nrbquote(%scan(&OR,&ORN, %str( ))); %end; %let ORN=%eval(&ORN-1); *===> count the percentiles that need to calculate the inflation factors; %let ipn=1; %let ip&ipn = %nrbquote(%scan(&ipctiles,&ipn, %str( ))); %do %while (&&ip&ipn ^=); %let ipn=%eval(&ipn+1); %let ip&ipn = %nrbquote(%scan(&ipctiles,&ipn, %str( ))); %end; %let ipn=%eval(&ipn-1); *===> create a dataset of control Proportions and ORs; Data P_OR; set _NULL_; run; %do j = 1 %to &P0N; %do k=1 %to &ORN; Data New; *==> proportion of disease or exposed in reference group; P0=&&P0&j; true_OR=&&OR&k; *==> proportion of disease or exposed in comparison group; P1 = (true_OR*P0/(1-P0))/(1+(true_OR*P0/(1-P0))); N0=&N0; N1=&N1; run; Data P_OR; set P_OR New; run; %end; *k; %end; *j; Proc sort data = P_OR; by P0 P1 true_OR N0 N1; run; *===> create datasets with individual subject data; Data Simmer; call streaminit(&seed); set P_OR; do Sim = 1 to &NSim; do group = 1 to 2; P = (group=1)*P0 + (group=2)*P1; *==> Total number of subjects in each group; N = (group=1)*N0 + (group=2)*N1; *==> Number of cases in each group; Ncases = rand("binomial", P, N); output; end; *group; end; *Sim; drop P; run; Proc SQL; create table maxSim as select P0, P1, true_OR, N0, N1, Sim, max(Ncases) as maxCases from Simmer group by P0, P1, true_OR, N0, N1, Sim order by P0, P1, true_OR, N0, N1, Sim; quit; *==> Only select the datasets with at least 1 or more cases; Data Simmer; merge Simmer maxSim; by P0 P1 true_OR N0 N1 Sim; if maxCases > 0; drop maxCases; run; Data Simmer; set Simmer; do case = 0 to 1; if case = 0 then counts = N - Ncases; if case = 1 then counts = Ncases; output; end; run; ods listing close; ods select none; Data OddsRatios; set _NULL_; run; *===> Chi-square test; %if %upcase(&Test) = CHISQ %then %do; ods output RelativeRisks=OddsRatios (keep=P0 P1 true_OR N0 N1 Sim Statistic Value) Chisq=Pvalues; Proc freq data = Simmer; by P0 P1 true_OR N0 N1 Sim; table case*group/Chisq OR; weight counts; run; Data OddsRatios; set OddsRatios; if Statistic in ("Odds Ratio"); _RROR_=Value; drop Statistic; run; Data Pvalues; set Pvalues; if Statistic = "Chi-Square"; pvalue=Prob; %if &nsided = 1 %then %do; pvalue=Prob/2; %end; %if &nsided = 2 %then %do; pvalue=Prob; %end; drop Statistic; run; %end; /* CHISQ */ %if %upcase(&Test) = EXACT %then %do; ods output OddsRatioExactCL=OddsRatios (keep=P0 P1 true_OR N0 N1 Sim Name1 nValue1) FishersExact=Pvalues; Proc freq data = Simmer; by P0 P1 true_OR N0 N1 Sim; table case*group/Fisher; exact OR; weight counts; run; Data OddsRatios; set OddsRatios; if Name1 in ("_RROR_"); _RROR_=nValue1; run; Data Pvalues; set Pvalues; if Name1 = "XP2_FISH"; %if &nsided = 1 %then %do; pvalue = nValue1/2; %end; %if &nsided = 2 %then %do; pvalue = nValue1; %end; run; %end; /* EXACT */ Data OddsRatios; merge OddsRatios Pvalues ; by P0 P1 true_OR N0 N1 Sim; if true_OR > 1 and _RROR_ > 1 and pvalue <= &alpha then do; Significance = 1; SigOR = _RROR_; end; else if true_OR < 1 and _RROR_ < 1 and pvalue <= &alpha then do; Significance = 1; SigOR = _RROR_; end; else do; Significance = 0; SigOR = .; end; run; Proc SQL noprint; select count(*) into: NOddsRatios from OddsRatios; quit; %let NOddsRatios=&NOddsRatios; %if &NOddsRatios = 0 %then %do; ods listing; ods select default; title; %if &outfile ^= %then %do; ods rtf file = "&outfile" startpage=no bodytitle; %end; data _null_; file print; put "All subjects have same outcome value. None of the datasets were valid for analysis"; file log; run; %if &outfile ^= %then %do; ods rtf close; %end; %end; *NOddsRatios = 0; %if &NOddsRatios > 0 %then %do; Proc SQL noprint; create table Power as select P0, P1, true_OR, N0, N1, count(*) as valid, round(avg(Significance),0.001) as Power from OddsRatios group by P0, P1, true_OR, N0, N1 order by P0, P1, true_OR, N0, N1; select count(*) into : NPower1 from OddsRatios where significance = 1; quit; %let NPower1 = &NPower1; %if &NPower1 = 0 %then %do; Data ESM; merge Power P_OR; by P0 P1 true_OR N0 N1; if valid = . then valid = 0; run; %end; *NPower1 = 0 ; %if &NPower1 > 0 %then %do; Proc univariate data =OddsRatios noprint; where significance = 1; by P0 P1 true_OR N0 N1; var SigOR; output out = SigORs pctlpts=&pctiles pctlpre= pctl; run; Data SigORs; set SigORs; %do v = 1 %to &ipn; %if &&ip&v = 2.5 %then %do; infl_P025 = pctl2_5/true_OR; %end; %if &&ip&v = 5 %then %do; infl_P05 = pctl5/true_OR; %end; %if &&ip&v = 10 %then %do; infl_P10 = pctl10/true_OR; %end; %if &&ip&v = 25 %then %do; infl_P25 = pctl25/true_OR; %end; %if &&ip&v = 50 %then %do; infl_P50 = pctl50/true_OR; %end; %if &&ip&v = 75 %then %do; infl_P75 = pctl75/true_OR; %end; %if &&ip&v = 90 %then %do; infl_P90 = pctl90/true_OR; %end; %if &&ip&v = 95 %then %do; infl_P95 = pctl95/true_OR; %end; %if &&ip&v = 97.5 %then %do; infl_P975 = pctl97_5/true_OR; %end; %end; run; Data ESM; merge Power SigORs P_OR; by P0 P1 true_OR N0 N1; if valid = . then valid = 0; run; %end; *NPower1 > 0; ods listing; ods select default; %if &outfile ^= %then %do; ods rtf file = "&outfile" startpage=no bodytitle; %end; %if %upcase(&Test) = CHISQ %then %do; title "CHI-SQUARE test from PROC FREQ"; %end; %if %upcase(&Test) = EXACT %then %do; title "EXACT test from PROC FREQ"; %end; %if &OR1 > 1 %then %do; title2 "Power and distribution of observed ORs > 1, &nsided.-sided test, alpha=&alpha"; %end; %if &&OR&ORN < 1 %then %do; title2 "Power and distribution of observed ORs < 1, &nsided.-sided test, alpha=&alpha"; %end; %if &OR1 < 1 and &&OR&ORN > 1 %then %do; title2 "Power and distribution of observed ORs with:"; title3 "observed ORs < 1 if true OR < 1 or observed ORs > 1 if true OR > 1, &nsided.-sided test, alpha=&alpha "; %end; Proc Print data = ESM noobs; format PCTL: infl: 6.3; run; %if &outfile ^= %then %do; ods rtf close; %end; %end; *NOddsRatios > 0; %Mend; *===> Examples of ESM; *===> replicate John Ioannidis' Table 2 using 2-sided test; *==> run 1; %ESM_proportion(P0= 0.30, OR= 1.1, N0=1000, N1=1000, Test=Chisq, alpha=0.05, nsided= 2, pctiles= 25 50 75 , ipctiles= 50, NSim=1000, seed=32375, outfile=); %ESM_proportion(P0= 0.30, OR= 1.1, N0=1000, N1=1000, Test=Chisq, alpha=0.05, nsided= 2, pctiles= 25 50 75 , ipctiles= 50, NSim=1000, seed=852375, outfile=); %ESM_proportion(P0= 0.30, OR= 1.1, N0=1000, N1=1000, Test=Chisq, alpha=0.05, nsided= 2, pctiles= 25 50 75 , ipctiles= 50, NSim=1000, seed=98547375, outfile=); %ESM_proportion(P0= 0.30, OR= 1.1, N0=1000, N1=1000, Test=Chisq, alpha=0.05, nsided= 2, pctiles= 25 50 75 , ipctiles= 50, NSim=1000, seed=2584865, outfile=); %ESM_proportion(P0= 0.30, OR= 1.1, N0=1000, N1=1000, Test=Chisq, alpha=0.05, nsided= 2, pctiles= 25 50 75 , ipctiles= 50, NSim=1000, seed=968542, outfile=); *==> run 2; %ESM_proportion(P0= 0.30, OR= 1.1, N0=250, N1=250, Test=Chisq, alpha=0.05, nsided= 2, pctiles= 25 50 75 , ipctiles= 50, NSim=1000, seed=32375, outfile=); %ESM_proportion(P0= 0.30, OR= 1.1, N0=250, N1=250, Test=Chisq, alpha=0.05, nsided= 2, pctiles= 25 50 75 , ipctiles= 50, NSim=1000, seed=4375, outfile=); %ESM_proportion(P0= 0.30, OR= 1.1, N0=250, N1=250, Test=Chisq, alpha=0.05, nsided= 2, pctiles= 25 50 75 , ipctiles= 50, NSim=1000, seed=87375, outfile=); %ESM_proportion(P0= 0.30, OR= 1.1, N0=250, N1=250, Test=Chisq, alpha=0.05, nsided= 2, pctiles= 25 50 75 , ipctiles= 50, NSim=1000, seed=684375, outfile=); %ESM_proportion(P0= 0.30, OR= 1.1, N0=250, N1=250, Test=Chisq, alpha=0.05, nsided= 2, pctiles= 25 50 75 , ipctiles= 50, NSim=1000, seed=237568, outfile=); *==> run 3; %ESM_proportion(P0= 0.30, OR= 1.25, N0=1000, N1=1000, Test=Chisq, alpha=0.05, nsided= 2, pctiles= 25 50 75 , ipctiles= 50, NSim=1000, seed=32375, outfile=); %ESM_proportion(P0= 0.30, OR= 1.25, N0=1000, N1=1000, Test=Chisq, alpha=0.05, nsided= 2, pctiles= 25 50 75 , ipctiles= 50, NSim=1000, seed=3375, outfile=); %ESM_proportion(P0= 0.30, OR= 1.25, N0=1000, N1=1000, Test=Chisq, alpha=0.05, nsided= 2, pctiles= 25 50 75 , ipctiles= 50, NSim=1000, seed=82375, outfile=); %ESM_proportion(P0= 0.30, OR= 1.25, N0=1000, N1=1000, Test=Chisq, alpha=0.05, nsided= 2, pctiles= 25 50 75 , ipctiles= 50, NSim=1000, seed=985375, outfile=); %ESM_proportion(P0= 0.30, OR= 1.25, N0=1000, N1=1000, Test=Chisq, alpha=0.05, nsided= 2, pctiles= 25 50 75 , ipctiles= 50, NSim=1000, seed=2842375, outfile=); *==> run 4; %ESM_proportion(P0= 0.30, OR= 1.25, N0=250, N1=250, Test=Chisq, alpha=0.05, nsided= 2, pctiles= 25 50 75 , ipctiles= 50, NSim=1000, seed=32375, outfile=); %ESM_proportion(P0= 0.30, OR= 1.25, N0=250, N1=250, Test=Chisq, alpha=0.05, nsided= 2, pctiles= 25 50 75 , ipctiles= 50, NSim=1000, seed=3237245, outfile=); %ESM_proportion(P0= 0.30, OR= 1.25, N0=250, N1=250, Test=Chisq, alpha=0.05, nsided= 2, pctiles= 25 50 75 , ipctiles= 50, NSim=1000, seed=85375, outfile=); %ESM_proportion(P0= 0.30, OR= 1.25, N0=250, N1=250, Test=Chisq, alpha=0.05, nsided= 2, pctiles= 25 50 75 , ipctiles= 50, NSim=1000, seed=4582375, outfile=); %ESM_proportion(P0= 0.30, OR= 1.25, N0=250, N1=250, Test=Chisq, alpha=0.05, nsided= 2, pctiles= 25 50 75 , ipctiles= 50, NSim=1000, seed=2375, outfile=); *==> run 5; %ESM_proportion(P0= 0.30, OR= 1.25, N0=50, N1=50, Test=Chisq, alpha=0.05, nsided= 2, pctiles= 25 50 75 , ipctiles= 50, NSim=1000, seed=32375, outfile=); %ESM_proportion(P0= 0.30, OR= 1.25, N0=50, N1=50, Test=Chisq, alpha=0.05, nsided= 2, pctiles= 25 50 75 , ipctiles= 50, NSim=1000, seed=126521, outfile=); %ESM_proportion(P0= 0.30, OR= 1.25, N0=50, N1=50, Test=Chisq, alpha=0.05, nsided= 2, pctiles= 25 50 75 , ipctiles= 50, NSim=1000, seed=5482547, outfile=); %ESM_proportion(P0= 0.30, OR= 1.25, N0=50, N1=50, Test=Chisq, alpha=0.05, nsided= 2, pctiles= 25 50 75 , ipctiles= 50, NSim=1000, seed=98524, outfile=); %ESM_proportion(P0= 0.30, OR= 1.25, N0=50, N1=50, Test=Chisq, alpha=0.05, nsided= 2, pctiles= 25 50 75 , ipctiles= 50, NSim=1000, seed=54265, outfile=); *===> results of runs per the orders in Stata paper, where Chi-square test was used; *==> run 1; %ESM_proportion(P0= 0.30, OR= 1.1, N0=1000, N1=1000, Test=Chisq, alpha=0.05, nsided= 2, pctiles= 25 50 75 , ipctiles= 50, NSim=1000, seed=32375, outfile=); %ESM_proportion(P0= 0.30, OR= 1.1, N0=1000, N1=1000, Test=Chisq, alpha=0.05, nsided= 2, pctiles= 25 50 75 , ipctiles= 50, NSim=1000, seed=852375, outfile=); %ESM_proportion(P0= 0.30, OR= 1.1, N0=1000, N1=1000, Test=Chisq, alpha=0.05, nsided= 2, pctiles= 25 50 75 , ipctiles= 50, NSim=1000, seed=98547375, outfile=); %ESM_proportion(P0= 0.30, OR= 1.1, N0=1000, N1=1000, Test=Chisq, alpha=0.05, nsided= 2, pctiles= 25 50 75 , ipctiles= 50, NSim=1000, seed=2584865, outfile=); %ESM_proportion(P0= 0.30, OR= 1.1, N0=1000, N1=1000, Test=Chisq, alpha=0.05, nsided= 2, pctiles= 25 50 75 , ipctiles= 50, NSim=1000, seed=968542, outfile=); *==> run 2; %ESM_proportion(P0= 0.30, OR= 1.1, N0=250, N1=250, Test=Chisq, alpha=0.05, nsided= 2, pctiles= 25 50 75 , ipctiles= 50, NSim=1000, seed=32375, outfile=); %ESM_proportion(P0= 0.30, OR= 1.1, N0=250, N1=250, Test=Chisq, alpha=0.05, nsided= 2, pctiles= 25 50 75 , ipctiles= 50, NSim=1000, seed=4375, outfile=); %ESM_proportion(P0= 0.30, OR= 1.1, N0=250, N1=250, Test=Chisq, alpha=0.05, nsided= 2, pctiles= 25 50 75 , ipctiles= 50, NSim=1000, seed=87375, outfile=); %ESM_proportion(P0= 0.30, OR= 1.1, N0=250, N1=250, Test=Chisq, alpha=0.05, nsided= 2, pctiles= 25 50 75 , ipctiles= 50, NSim=1000, seed=684375, outfile=); %ESM_proportion(P0= 0.30, OR= 1.1, N0=250, N1=250, Test=Chisq, alpha=0.05, nsided= 2, pctiles= 25 50 75 , ipctiles= 50, NSim=1000, seed=237568, outfile=); *==> run 3; %ESM_proportion(P0= 0.30, OR= 1.25, N0=1000, N1=1000, Test=Chisq, alpha=0.05, nsided= 2, pctiles= 25 50 75 , ipctiles= 50, NSim=1000, seed=32375, outfile=); %ESM_proportion(P0= 0.30, OR= 1.25, N0=1000, N1=1000, Test=Chisq, alpha=0.05, nsided= 2, pctiles= 25 50 75 , ipctiles= 50, NSim=1000, seed=3375, outfile=); %ESM_proportion(P0= 0.30, OR= 1.25, N0=1000, N1=1000, Test=Chisq, alpha=0.05, nsided= 2, pctiles= 25 50 75 , ipctiles= 50, NSim=1000, seed=82375, outfile=); %ESM_proportion(P0= 0.30, OR= 1.25, N0=1000, N1=1000, Test=Chisq, alpha=0.05, nsided= 2, pctiles= 25 50 75 , ipctiles= 50, NSim=1000, seed=985375, outfile=); %ESM_proportion(P0= 0.30, OR= 1.25, N0=1000, N1=1000, Test=Chisq, alpha=0.05, nsided= 2, pctiles= 25 50 75 , ipctiles= 50, NSim=1000, seed=2842375, outfile=); *==> run 4; %ESM_proportion(P0= 0.30, OR= 1.25, N0=250, N1=250, Test=Chisq, alpha=0.05, nsided= 2, pctiles= 25 50 75 , ipctiles= 50, NSim=1000, seed=32375, outfile=); %ESM_proportion(P0= 0.30, OR= 1.25, N0=250, N1=250, Test=Chisq, alpha=0.05, nsided= 2, pctiles= 25 50 75 , ipctiles= 50, NSim=1000, seed=3237245, outfile=); %ESM_proportion(P0= 0.30, OR= 1.25, N0=250, N1=250, Test=Chisq, alpha=0.05, nsided= 2, pctiles= 25 50 75 , ipctiles= 50, NSim=1000, seed=85375, outfile=); %ESM_proportion(P0= 0.30, OR= 1.25, N0=250, N1=250, Test=Chisq, alpha=0.05, nsided= 2, pctiles= 25 50 75 , ipctiles= 50, NSim=1000, seed=4582375, outfile=); %ESM_proportion(P0= 0.30, OR= 1.25, N0=250, N1=250, Test=Chisq, alpha=0.05, nsided= 2, pctiles= 25 50 75 , ipctiles= 50, NSim=1000, seed=2375, outfile=); *==> run 5; %ESM_proportion(P0= 0.30, OR= 1.25, N0=50, N1=50, Test=Chisq, alpha=0.05, nsided= 2, pctiles= 25 50 75 , ipctiles= 50, NSim=1000, seed=32375, outfile=); %ESM_proportion(P0= 0.30, OR= 1.25, N0=50, N1=50, Test=Chisq, alpha=0.05, nsided= 2, pctiles= 25 50 75 , ipctiles= 50, NSim=1000, seed=126521, outfile=); %ESM_proportion(P0= 0.30, OR= 1.25, N0=50, N1=50, Test=Chisq, alpha=0.05, nsided= 2, pctiles= 25 50 75 , ipctiles= 50, NSim=1000, seed=5482547, outfile=); %ESM_proportion(P0= 0.30, OR= 1.25, N0=50, N1=50, Test=Chisq, alpha=0.05, nsided= 2, pctiles= 25 50 75 , ipctiles= 50, NSim=1000, seed=98524, outfile=); %ESM_proportion(P0= 0.30, OR= 1.25, N0=50, N1=50, Test=Chisq, alpha=0.05, nsided= 2, pctiles= 25 50 75 , ipctiles= 50, NSim=1000, seed=54265, outfile=); *===> Table 1 (John Ioannidis' Table 2) using 1-sided test; *==> run 1; %ESM_proportion(P0= 0.30, OR= 1.1, N0=1000, N1=1000, Test=Chisq, alpha=0.05, nsided= 1, pctiles= 25 50 75 , ipctiles= 50, NSim=1000, seed=32375, outfile=); %ESM_proportion(P0= 0.30, OR= 1.1, N0=1000, N1=1000, Test=Chisq, alpha=0.05, nsided= 1, pctiles= 25 50 75 , ipctiles= 50, NSim=1000, seed=852375, outfile=); %ESM_proportion(P0= 0.30, OR= 1.1, N0=1000, N1=1000, Test=Chisq, alpha=0.05, nsided= 1, pctiles= 25 50 75 , ipctiles= 50, NSim=1000, seed=98547375, outfile=); %ESM_proportion(P0= 0.30, OR= 1.1, N0=1000, N1=1000, Test=Chisq, alpha=0.05, nsided= 1, pctiles= 25 50 75 , ipctiles= 50, NSim=1000, seed=2584865, outfile=); %ESM_proportion(P0= 0.30, OR= 1.1, N0=1000, N1=1000, Test=Chisq, alpha=0.05, nsided= 1, pctiles= 25 50 75 , ipctiles= 50, NSim=1000, seed=968542, outfile=); *==> run 2; %ESM_proportion(P0= 0.30, OR= 1.1, N0=250, N1=250, Test=Chisq, alpha=0.05, nsided= 1, pctiles= 25 50 75 , ipctiles= 50, NSim=1000, seed=32375, outfile=); %ESM_proportion(P0= 0.30, OR= 1.1, N0=250, N1=250, Test=Chisq, alpha=0.05, nsided= 1, pctiles= 25 50 75 , ipctiles= 50, NSim=1000, seed=4375, outfile=); %ESM_proportion(P0= 0.30, OR= 1.1, N0=250, N1=250, Test=Chisq, alpha=0.05, nsided= 1, pctiles= 25 50 75 , ipctiles= 50, NSim=1000, seed=87375, outfile=); %ESM_proportion(P0= 0.30, OR= 1.1, N0=250, N1=250, Test=Chisq, alpha=0.05, nsided= 1, pctiles= 25 50 75 , ipctiles= 50, NSim=1000, seed=684375, outfile=); %ESM_proportion(P0= 0.30, OR= 1.1, N0=250, N1=250, Test=Chisq, alpha=0.05, nsided= 1, pctiles= 25 50 75 , ipctiles= 50, NSim=1000, seed=237568, outfile=); *==> run 3; %ESM_proportion(P0= 0.30, OR= 1.25, N0=1000, N1=1000, Test=Chisq, alpha=0.05, nsided= 1, pctiles= 25 50 75 , ipctiles= 50, NSim=1000, seed=32375, outfile=); %ESM_proportion(P0= 0.30, OR= 1.25, N0=1000, N1=1000, Test=Chisq, alpha=0.05, nsided= 1, pctiles= 25 50 75 , ipctiles= 50, NSim=1000, seed=3375, outfile=); %ESM_proportion(P0= 0.30, OR= 1.25, N0=1000, N1=1000, Test=Chisq, alpha=0.05, nsided= 1, pctiles= 25 50 75 , ipctiles= 50, NSim=1000, seed=82375, outfile=); %ESM_proportion(P0= 0.30, OR= 1.25, N0=1000, N1=1000, Test=Chisq, alpha=0.05, nsided= 1, pctiles= 25 50 75 , ipctiles= 50, NSim=1000, seed=985375, outfile=); %ESM_proportion(P0= 0.30, OR= 1.25, N0=1000, N1=1000, Test=Chisq, alpha=0.05, nsided= 1, pctiles= 25 50 75 , ipctiles= 50, NSim=1000, seed=2842375, outfile=); *==> run 4; %ESM_proportion(P0= 0.30, OR= 1.25, N0=250, N1=250, Test=Chisq, alpha=0.05, nsided= 1, pctiles= 25 50 75 , ipctiles= 50, NSim=1000, seed=32375, outfile=); %ESM_proportion(P0= 0.30, OR= 1.25, N0=250, N1=250, Test=Chisq, alpha=0.05, nsided= 1, pctiles= 25 50 75 , ipctiles= 50, NSim=1000, seed=3237245, outfile=); %ESM_proportion(P0= 0.30, OR= 1.25, N0=250, N1=250, Test=Chisq, alpha=0.05, nsided= 1, pctiles= 25 50 75 , ipctiles= 50, NSim=1000, seed=85375, outfile=); %ESM_proportion(P0= 0.30, OR= 1.25, N0=250, N1=250, Test=Chisq, alpha=0.05, nsided= 1, pctiles= 25 50 75 , ipctiles= 50, NSim=1000, seed=4582375, outfile=); %ESM_proportion(P0= 0.30, OR= 1.25, N0=250, N1=250, Test=Chisq, alpha=0.05, nsided= 1, pctiles= 25 50 75 , ipctiles= 50, NSim=1000, seed=2375, outfile=); *==> run 5; %ESM_proportion(P0= 0.30, OR= 1.25, N0=50, N1=50, Test=Chisq, alpha=0.05, nsided= 1, pctiles= 25 50 75 , ipctiles= 50, NSim=1000, seed=32375, outfile=); %ESM_proportion(P0= 0.30, OR= 1.25, N0=50, N1=50, Test=Chisq, alpha=0.05, nsided= 1, pctiles= 25 50 75 , ipctiles= 50, NSim=1000, seed=126521, outfile=); %ESM_proportion(P0= 0.30, OR= 1.25, N0=50, N1=50, Test=Chisq, alpha=0.05, nsided= 1, pctiles= 25 50 75 , ipctiles= 50, NSim=1000, seed=5482547, outfile=); %ESM_proportion(P0= 0.30, OR= 1.25, N0=50, N1=50, Test=Chisq, alpha=0.05, nsided= 1, pctiles= 25 50 75 , ipctiles= 50, NSim=1000, seed=98524, outfile=); %ESM_proportion(P0= 0.30, OR= 1.25, N0=50, N1=50, Test=Chisq, alpha=0.05, nsided= 1, pctiles= 25 50 75 , ipctiles= 50, NSim=1000, seed=54265, outfile=); *===> Examples in Karolinaka Institude's Working Paper: Resin Worker Example; %ESM_proportion(P0= 0.2138103, OR= 1.2 1.5 2 3, N0=1202, N1=139, Test=Chisq, alpha=0.05, nsided= 1, pctiles= 10 50 90 , ipctiles=50, NSim=1000, seed=32375, outfile=); %ESM_proportion(P0= 0.2138103, OR= 1.2 1.5 2 3, N0=12020, N1=1390, Test=Chisq, alpha=0.05, nsided= 1, pctiles= 10 50 90 , ipctiles=, NSim=1000, seed=32375, outfile=); *===> Illustrative Test Case #2 in Karolinaka Institude's Working Paper: Atrazine ; %ESM_proportion(P0= 0.04, OR= 1.2, N0=25, N1=25, Test=Chisq, alpha=0.05, nsided= 1, pctiles= 10 50 90 , ipctiles=50, NSim=100000, seed=323750, outfile=); %ESM_proportion(P0= 0.04, OR= 1.2, N0=25, N1=25, Test=Exact, alpha=0.05, nsided= 1, pctiles= 10 50 90 , ipctiles=50, NSim=100000, seed=323750, outfile=);